import React from 'react';
import { View, Text, TouchableOpacity, Image } from 'react-native';
import { AppStyles, AppColors, TextStyles } from '../theme/uiLib.config';
import { useRouter } from 'expo-router';

const BindSuccess = () => {
  const router = useRouter();

  return (
    <View style={[AppStyles.pagePadding, { flex: 1, alignItems: 'center', justifyContent: 'flex-start' }]}>
      {/* 显示成功图标 */}
      <Image
        source={require('../../assets/images/success.png')}
        style={{ width: 100, height: 100, marginTop: 200}} // 设置图标大小
        resizeMode="contain"
      />
      
      {/* 显示绑定成功的文本 */}
      <Text style={[TextStyles.h0, {color: AppColors.tertiary, textAlign: 'center', marginTop: 20 }]}>绑定完成</Text>

      {/* 兑换按钮 */}
      <TouchableOpacity
              style={{
                alignSelf: 'center',
                justifyContent: 'center',
                width: '90%',
                height: 60,
                backgroundColor: AppColors.primary,
                paddingVertical: 15,
                borderRadius: 24,
                marginTop: 200,
              }}
        onPress={() => {
          router.push('/Insure/AddInsurance');
        }}
      >
       <Text style={[TextStyles.h2, { color: '#fff', textAlign: 'center' }]}>兑换万户健康保</Text>
      </TouchableOpacity>

      {/* 返回首页的文字链接 */}
      <TouchableOpacity onPress={() => router.push('/')}>
        <Text style={[TextStyles.primary, { marginTop: 20, textDecorationLine: 'underline' }]}>返回首页</Text>
      </TouchableOpacity>
    </View>
  );
};

export default BindSuccess;
